#!/usr/bin/env python
# coding: utf-8
'''
Created on 2014年7月17日

@author: Administrator
'''

'''
@
'''

import re

FILE_PATH = r"/Users/monstar-216/Downloads/point0922.txt"

if __name__ == "__main__":
    print '-----'
    
    p = re.compile(r'\d+')
    
    res = {}
    current_line = -1
    with open(FILE_PATH) as f:
        for line in f:
            if not line.strip() is "":
                if line.find("P") == 0:
                    current_line += 1
                    print '--------'
                    res[current_line] = []
                else:
                    s = re.findall(p, line)
                    t = {
                     "x":int(s[0]),
                     "y":int(s[1])
                     }
                    res[current_line].append(t)
        print res
        
